using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DAL;
using DTO;
using BLL;

namespace QLSV
{
    public partial class dangnhap : Form
    {
        sinhvienDAL sinhvien = new sinhvienDAL();
        public dangnhap()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void dang_nhap_Click(object sender, EventArgs e)
        {
            
            if (taikhoan.Text == "" || matkhau.Text == "")
            {
                thongbao.Text = "tai khoan mat khau khong duoc trong";
            }
            else
            {
                int kq = sinhvien.kiemtratk(taikhoan.Text,matkhau.Text);
                if (kq == 1)
                {
                    SetVisibleCore(false);

                    MessageBox.Show("dang nhap thanh cong", "thongbao", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    Form1 fr = new Form1();
                    fr.ShowDialog();

                }
                else
                {
                    thongbao.Text = "ten dang nhap hoacmat khau khong dung";
                }
            }
        }
    }
}